#pragma once

#include <thread>

template <typename T>
class BlockingQueuePro;
class SqlOperation;
class ConnObject;

class MySQLWorker
{
public:
    MySQLWorker(BlockingQueuePro<SqlOperation*> &queue,ConnObject *obj):task_queue_(queue),obj_(obj){}
    ~MySQLWorker(){
        Close();
    };
    void Start();
    void Close();

private:
    void worker();

    std::thread thread_;
    BlockingQueuePro<SqlOperation*> &task_queue_;
    ConnObject *obj_;
};


